import time
a=[]
x=0
t=0
def bubble (f):
    st=time.time()
    for i in f:
        a.append(int(i))
    for x in range (len(a)-1):
        for y in range (len(a)-2,x-1,-1):
            if a[y]>a[y+1]:
                a[y],a[y+1]=a[y+1],a[y]
    end=time.time()
    t=(end-st)*1000
    return t
f1=open("m1_sorted.txt")
f2=open("m2_reverse.txt")
f3=open("m3_shuffle.txt")
print("m1_sorted.txt",int(bubble (f1)), "milesecond")
print("m2_reverse.txt",int(bubble (f2)), "milesecond")
print("m3_shuffle.txt",int(bubble (f3)), "milesecond")
    
